package com.cb.web.wasf.sample.model;

import com.google.common.base.Preconditions;
import java.io.Serializable;
import java.util.List;

/**
 * @author CBO
 */
public class SubList<T> implements Serializable {

    private final List<T> list;
    private final int fromIndex;
    private final int countAll;

    public SubList(List<T> list, int fromIndex, int countAll) {
        Preconditions.checkNotNull(list);
        this.list = list;
        this.fromIndex = fromIndex;
        this.countAll = countAll;
    }

    public List<T> getList() {
        return list;
    }

    public int getCount() {
        return list.size();
    }

    public int getCountAll() {
        return countAll;
    }

    public int getFromIndex() {
        return fromIndex;
    }
}
